/*
 * button.c
 *
 *  Created on: 2012-9-17
 *      Author: dell
 */
#include "button.h"


bool start_button = FALSE;
bool up_button = FALSE;
bool down_button = FALSE;
bool left_button = FALSE;
bool right_button = FALSE;

void startButtonPress()
{
	if(GPIO_ReadInputDataBit(PORT_SW_START, PIN_SW_START) != SET)
	{
		start_button = TRUE;
	}
}

void upButtonPress()
{
	if(GPIO_ReadInputDataBit(PORT_SW_UP, PIN_SW_UP) != SET)
	{
		up_button = TRUE;
	}
}

void downButtonPress()
{
	if(GPIO_ReadInputDataBit(PORT_SW_DOWN, PIN_SW_DOWN) != SET)
	{
		down_button = TRUE;
	}
}

void leftButtonPress()
{
	if(GPIO_ReadInputDataBit(PORT_SW_LEFT, PIN_SW_LEFT) != SET)
	{
		left_button = TRUE;
	}
}

void rightButtonPress()
{
	if(GPIO_ReadInputDataBit(PORT_SW_RIGHT, PIN_SW_RIGHT) != SET)
	{
		right_button = TRUE;
	}
}

